package com.qiall.gateway.controller.convert;

import com.qiall.assertutil.Assert;
import com.qiall.common.request.BaseActivity;
import com.qiall.common.request.BaseResponse;
import com.qiall.gateway.controller.request.AddApiRequest;
import org.springframework.stereotype.Component;

@Component
public class AddApiPreCheckActivity extends BaseActivity<AddApiRequest, BaseResponse> {
    @Override
    public void handler(AddApiRequest request, BaseResponse response) {
        nullCheck(request);
    }

    private void nullCheck(AddApiRequest request) {
        Assert.notNull(request.getApiName(), "api称为空");
        Assert.notNull(request.getApiPath(), "请求路径为空");
        Assert.notNull(request.getServiceName(), "dubbo 服务为空");
        Assert.notNull(request.getMethodName(), "请求方法为空");

    }
}
